<?php
class programme extends Model
{
    public $id;
	public $path;
	public $primary_category_id;
	public $category_list;
	public $first_network_codes;
	public $first_episode_time_onair;
	public $last_episode_time_onair;
	public $meta_keywords;
	public $meta_description;
	public $publish_datetime;
	public $expire_datetime;
	public $country_allow_list;
	public $country_deny_list;
	public $created_at;
	public $modified_at;
	public $number_of_episodes;
	public $minisite_url;
	public $blog_url;
	public $forum_id;
	public $main_cast;
	public $side_cast;
	public $host;
	public $guest_host;
	public $guest;
	public $performing_guest;
	public $dancer;
	public $judge;
	public $participant;
	public $executive_producer;
	public $producer;
	public $supervisor;
	public $editor;
	public $story;
	public $dubbing_artiste;
	public $title;
	public $title_zh;
	public $title_en;
	public $description;
	public $description_zh;
	public $description_en;
	public $description_short;
	public $description_short_zh;
	public $description_short_en;
	public $first_onair_information;
	public $first_onair_information_zh;
	public $first_onair_information_en;
	public $tags;
	public $nominal_duration;
	public $banner_image;
	public $key_art_image;
	public $first_time_onair;
	public $objective;
	public $starting_episode_no;
	public $production_start_date;
	public $fact_background;
	public $fact_background_zh;
	public $fact_background_en;
	public $mytv_view;
	public $mytv_plus_view;
	public $mytv_fav;
	public $mytv_plus_fav;

    public static function getTableName()
    {
        return 'programme';
    }

    public function set($obj)
    {
        foreach (get_object_vars($this) as $field=>$value) {
            $this->$field = isset($obj->$field) ? $obj->$field : '';
        }
    }

    public function insert($obj)
    {
        return Model::$dbo['w']->save($obj);
    }

    public function update($obj)
    {
        return Model::$dbo['w']->save($obj);
    }

    public function delete($obj)
    {
        return Model::$dbo['w']->deleteInstance($this->getTableName(),$obj->id);
    }
}
?>
